package com.es.disped.dao.oj.mapper;

import com.es.disped.dao.oj.model.Users;
import com.es.disped.dao.oj.model.UsersExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface UsersMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table users
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=UsersSqlProvider.class, method="countByExample")
    long countByExample(UsersExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table users
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @DeleteProvider(type=UsersSqlProvider.class, method="deleteByExample")
    int deleteByExample(UsersExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table users
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Delete({
        "delete from users",
        "where user_id = #{userId,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String userId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table users
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Insert({
        "insert into users (user_id, email, ",
        "submit, solved, ",
        "defunct, ip, accesstime, ",
        "volume, language, ",
        "password, reg_time, ",
        "nick, school)",
        "values (#{userId,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, ",
        "#{submit,jdbcType=INTEGER}, #{solved,jdbcType=INTEGER}, ",
        "#{defunct,jdbcType=CHAR}, #{ip,jdbcType=VARCHAR}, #{accesstime,jdbcType=TIMESTAMP}, ",
        "#{volume,jdbcType=INTEGER}, #{language,jdbcType=INTEGER}, ",
        "#{password,jdbcType=VARCHAR}, #{regTime,jdbcType=TIMESTAMP}, ",
        "#{nick,jdbcType=VARCHAR}, #{school,jdbcType=VARCHAR})"
    })
    int insert(Users record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table users
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @InsertProvider(type=UsersSqlProvider.class, method="insertSelective")
    int insertSelective(Users record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table users
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=UsersSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="user_id", property="userId", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
        @Result(column="submit", property="submit", jdbcType=JdbcType.INTEGER),
        @Result(column="solved", property="solved", jdbcType=JdbcType.INTEGER),
        @Result(column="defunct", property="defunct", jdbcType=JdbcType.CHAR),
        @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR),
        @Result(column="accesstime", property="accesstime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="volume", property="volume", jdbcType=JdbcType.INTEGER),
        @Result(column="language", property="language", jdbcType=JdbcType.INTEGER),
        @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
        @Result(column="reg_time", property="regTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="nick", property="nick", jdbcType=JdbcType.VARCHAR),
        @Result(column="school", property="school", jdbcType=JdbcType.VARCHAR)
    })
    List<Users> selectByExample(UsersExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table users
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Select({
        "select",
        "user_id, email, submit, solved, defunct, ip, accesstime, volume, language, password, ",
        "reg_time, nick, school",
        "from users",
        "where user_id = #{userId,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="user_id", property="userId", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="email", property="email", jdbcType=JdbcType.VARCHAR),
        @Result(column="submit", property="submit", jdbcType=JdbcType.INTEGER),
        @Result(column="solved", property="solved", jdbcType=JdbcType.INTEGER),
        @Result(column="defunct", property="defunct", jdbcType=JdbcType.CHAR),
        @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR),
        @Result(column="accesstime", property="accesstime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="volume", property="volume", jdbcType=JdbcType.INTEGER),
        @Result(column="language", property="language", jdbcType=JdbcType.INTEGER),
        @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR),
        @Result(column="reg_time", property="regTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="nick", property="nick", jdbcType=JdbcType.VARCHAR),
        @Result(column="school", property="school", jdbcType=JdbcType.VARCHAR)
    })
    Users selectByPrimaryKey(String userId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table users
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=UsersSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Users record, @Param("example") UsersExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table users
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=UsersSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Users record, @Param("example") UsersExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table users
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=UsersSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Users record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table users
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Update({
        "update users",
        "set email = #{email,jdbcType=VARCHAR},",
          "submit = #{submit,jdbcType=INTEGER},",
          "solved = #{solved,jdbcType=INTEGER},",
          "defunct = #{defunct,jdbcType=CHAR},",
          "ip = #{ip,jdbcType=VARCHAR},",
          "accesstime = #{accesstime,jdbcType=TIMESTAMP},",
          "volume = #{volume,jdbcType=INTEGER},",
          "language = #{language,jdbcType=INTEGER},",
          "password = #{password,jdbcType=VARCHAR},",
          "reg_time = #{regTime,jdbcType=TIMESTAMP},",
          "nick = #{nick,jdbcType=VARCHAR},",
          "school = #{school,jdbcType=VARCHAR}",
        "where user_id = #{userId,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(Users record);
}